<h1><?php __('Edit user'); ?></h1>

<?php if ($currentUser['AgencyUser']['id'] != $agencyUser['AgencyUser']['id']): ?>
<ul class="options">
    <li><?php
    echo $html->link(
        $html->image('icons/user--minus.png').' '.__('Delete this user', true),
        array(
            'action' => 'delete',
            'admin' => true,
            $agencyUser['AgencyUser']['id']
        ),
        array('escape' => false)
    );
    ?></li>
</ul>
<?php endif; ?>

<div class="box">

    <h2>General information</h2>

    <?php
    echo $form->create('AgencyUser', array('url' => $currentUrl));
    ?>

        <?php echo $form->input('id'); ?>

        <?php
        if ($currentUser['AgencyUser']['id'] != $agencyUser['AgencyUser']['id']):
            echo $form->input('username', array(
                'size' => 40
            ));
        else:
            echo $form->input('username', array(
                'size' => 40,
                'disabled' => true,
                'after' => __('You cannot change your own username', true)
            ));
        endif;
        ?>

        <?php
        echo $form->input('name', array(
            'size' => 50
        ));
        ?>

        <?php
        echo $form->input('email', array(
            'size' => 50
        ));
        ?>

        <?php
        if ($currentUser['AgencyUser']['id'] != $agencyUser['AgencyUser']['id']):
            echo $form->input('can_log_in', array(
                'label' => __('This user can log in', true)
            ));
        endif;
        ?>

    <?php
    echo $form->end(__('Save', true));
    ?>

</div>

<div class="box">

    <h2>Password</h2>

    <?php
    echo $form->create('AgencyUser', array('url' => $currentUrl));
    ?>

        <?php
        echo $form->input('new_password', array(
            'label' => __('New password', true),
            'type' => 'password',
            'size' => 40
        ));
        ?>

        <?php
        echo $form->input('confirm_password', array(
            'label' => __('Confirm password', true),
            'type' => 'password',
            'size' => 40
        ));
        ?>

    
    <?php
    echo $form->end(__('Change password', true));
    ?>

</div>